package com.example.statistics.bean;

import com.jhj.slimadapter.model.BaseTreeModel;

import org.jetbrains.annotations.Nullable;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PurchaseTreeBean extends BaseTreeModel<PurchaseTreeBean> implements Serializable {

    private int id;
    private String title;
    private String subtitle;
    private String type;
    private String time;
    private List<PurchaseTreeBean> children;
    private String status;
    private boolean root;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public void setChildren(List<PurchaseTreeBean> children) {
        this.children = children;
    }

    @Override
    public boolean isRoot() {
        return root;
    }

    @Override
    public void setRoot(boolean b) {
        this.root = b;
    }

    @Nullable
    @Override
    public ArrayList<PurchaseTreeBean> getChildren() {
        if (children == null)
            return new ArrayList<PurchaseTreeBean>();
        return (ArrayList<PurchaseTreeBean>) children;
    }
}
